
macro(spark_install _IN_PACKAGE)
    set(CMAKE_INSTALL_PREFIX "${_IN_PACKAGE}")
endmacro(spark_install _IN_PACKAGE)

# spark_install_file
# 安装文件到指定位置
macro(spark_install_file IN_FILE IN_PATH)
    string(LENGTH ${IN_PATH} IN_PATH_LENGTH)
    if(IN_PATH_LENGTH GREATER_EQUAL 1)
        string(SUBSTRING ${IN_PATH} 0 1 IN_PATH_1)
        if(IN_PATH_1 STREQUAL "/")
            install(FILES ${IN_FILE} DESTINATION  ${IN_PATH})
        else() 
            install(FILES ${IN_FILE} DESTINATION  ${CMAKE_INSTALL_PREFIX}/${IN_PATH})
        endif(IN_PATH_1 STREQUAL "/")
    else()
        message(FATAL_ERROR "spark_install_file requires two arguments, which cannot be null")
        # string(SUBSTRING ${IN_PATH} 0 1 IN_PATH_1)
        # install(FILES ${IN_FILE} DESTINATION  ${CMAKE_INSTALL_PREFIX}/${IN_PATH})
    endif(IN_PATH_LENGTH GREATER_EQUAL 1)

endmacro(spark_install_file IN_FILE IN_PATH)

